<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>

	<head>

		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title>仪器共享</title>

		<meta name="keywords" content="科研仪器，生命科学仪器，环境检测仪器，实验常用设备，分析仪器">

		<meta name="description" content="中国领先的科研仪器共享平台，让您快速找到各种类型的科学研究仪器。提升闲置仪器利用率，产生更大科研价值。涵盖：生命科学仪器、环境检测仪器、实验常用设备、分析仪器、仪表、物性测试、测量/计量仪器、在线及过程控制仪器。

">
		<!--<link rel="stylesheet" href="new_css/header_footer.css?t=1">-->
		<link rel="stylesheet" href="new_css/publishService.css">
		<link rel="stylesheet" href="css/new_style.css">
	<link rel="stylesheet" type="text/css" href="imageDom/globle.css" />
		<link rel="stylesheet" href="css/reset.css">
		<link rel="stylesheet" href="css/common.css">
		<script src="new_js/jquery-1.11.3.js"></script>
		<style>
			.mainList .content .right .title{
				margin-left: 30px;
			}
			.main-content-mid {
				/*margin-left: 40px;*/
			}
			.mainList .content    {
				width: 100%;
				overflow: hidden;
				 height: 100% !important;
			}
			.mainList .content .right{
				height: 100% !important;
			}


			/*小箭头*/

			.sun_item>.sun_item_div1:after, .sun_item>.sun_item_div1:before {
				border: solid transparent;
				content: '';
				height: 0;
				left: 100%;
				position: absolute;
				width: 0;
			}
			.sun_item>.sun_item_div1:before {
				border-width: 12px;
				border-left-color: rgba(196,196,196,1);
				top: 75px;
			}
			.sun_item>.sun_item_div1:after {
				border-width: 10px;
				border-left-color: #fff;
				top: 77px;
			}


			/*goods-comm-stars style*/
			.goods-comm{height:41px;position:relative;z-index:7;}
			.goods-comm-stars{line-height:25px;height:41px;position:absolute;top:0px;left:0;width:400px;}
			.goods-comm-stars .star_l{float:left;display:inline-block;margin-right:5px;display:inline;}
			.goods-comm-stars .star_choose{float:left;display:inline-block;}

			.goods-comm{height:41px;position:relative;z-index:7;}
			.goods-comm-stars1{line-height:25px;height:41px;position:absolute;top:0px;left:0;width:400px;}
			.goods-comm-stars1 .star_l{float:left;display:inline-block;margin-right:5px;display:inline;}
			.goods-comm-stars1 .star_choose{float:left;display:inline-block;}
			/* rater star */
			.rater-star{position:relative;list-style:none;margin:0;padding:0;background-repeat:repeat-x;background-position:left top;float:left;}
			.rater-star-item, .rater-star-item-current{position:absolute;top:0;left:0;background-repeat:repeat-x;}
			.rater-star-item-hover{position:absolute;top:0;left:0;background-repeat:repeat-x; z-index: 999 !important;}
			.rater-star-item{background-position: -100% -100%;}
			.rater-star-item-hover{background-position:0 -48px;cursor:pointer;}
			.rater-star-item-current{background-position:0 -48px;cursor:pointer;}
			.rater-star-item-current.rater-star-happy{background-position:0 -25px;}
			.rater-star-item-hover.rater-star-happy{background-position:0 -25px;}
			.rater-star-item-current.rater-star-full{background-position:0 -72px;}
			/* popinfo */
			.popinfo{display:none;position:absolute;top:30px;background:url(images/infobox-bg.gif) no-repeat;padding-top:8px;width:192px;margin-left:-14px;}
			.popinfo .info-box{border:1px solid #f00;border-top:0;padding:0 5px;color:#F60;background:#FFF;}
			.popinfo .info-box div{color:#333;}
			.rater-click-tips{font:12px/25px;color:#333;margin-left:10px;background:url(images/infobox-bg-l.gif) no-repeat 0 0;width:151px;height:34px;padding-left:16px;overflow:hidden;}
			.rater-click-tips span{display:block;background:#FFF9DD url(images/infobox-bg-l-r.gif) no-repeat 100% 0;height:34px;line-height:34px;padding-right:5px;}
			.rater-star-item-tips{background:url(images/star-tips.gif) no-repeat 0 0;height:41px;overflow:hidden;}
			.cur.rater-star-item-tips{display:block;}
			.rater-star-result{color:#FF6600;font-weight:bold;padding-left:10px;float:left;}



			/*评论*/
			.commentary{
				width:935px;
				height:402px;
				border: 1px solid #C4C4C4;
			}
			.commentary .buyer-evaluation{
				width: 467px;
				border-right: 1px solid #d2d2d2;




			}
			.commentary .buyer-evaluation .buyer-evaluation-title{
				height: 41px;
				line-height: 41px;
				margin: 8px auto;
				text-align: center;


				/*border-bottom: 1px solid #d2d2d2;*/

			}
			.commentary .buyer-evaluation .buyer-evaluation-title p{
				padding-bottom: 8px;
				border-bottom: 1px solid #d2d2d2;
				color: #1A1A1A;
				font-size:16px;
				/**/
			}




			.buyer-evaluation-content ul li span{
				color: #FF8A00;
			}

			.mainList .content .right ul li label {
				width: 100px;
				display: inline-block;
				/*text-align: right;*/
				padding-right: 20px;
			}
			.mainList .content .right ul .item11 select {
				height: 54px;
				width: 477px;
			}

			.mainList .content .right ul .item4 textarea {
				width: 468px;
				height: 183px;
				vertical-align: middle;
			}


			.mainList .content .title {
				width: 100%;
				height: 47px;
				border-bottom: 1px solid #d3d3d3;
				line-height: 44px;
				font-size: 18px;
				color: #202020;
				margin: 20px auto;
			}

			.mainList .content .title-bot{
				width: 100%;
				height: 47px;
				line-height: 44px;
				font-size: 16px;
				color: #202020;
				margin: 20px 0px 20px 30px;
			}

			.mainList .content .title span {
				display: inline-block;
				height: 100%;
				border-bottom: 2px solid #ff8a00;
			}
			.sun_item>.sun_item_div2 {
				display: inline-block;
				float: left;
				width: 989px;
				height: 172px;
				padding: 0 60px;
				border: none;
				border-bottom: 1px solid rgba(196,196,196,1);
				border-left: 1px solid rgba(196,196,196,1);
			}

			.biaodan {
				margin-left: 30px;
			}
			.service-bar{
				width: 100%;
				max-width: 1198px;
				height: 36px;
				background-color: #EDEDED;
			}
			.service-bar ul li {
				display: inline-block;
				line-height: 36px;
				width: 560px;
				padding-left: 30px;
			}

			.service-left{
				width: 597px;
				min-height: 480px;
				height: 100%;
			}
			.service-item{
				width:550px;
				/*height: 100px;*/
				margin: 20px auto;
			}
			div#evaluateDiv {
				height: 100%;
				min-height: 145px;
			}
			.service-item .service-item-img img{
				width: 90px;
				height: 90px;
				border: 1px solid #efefef;
				margin: 0px 20px 0px 10px;
			}
			/*字数限制*/
			.service-item .service-item-content ul li{
				overflow: hidden; /*自动隐藏文字*/
				text-overflow: ellipsis;/*文字隐藏后添加省略号*/
				white-space: nowrap;/*强制不换行*/
				width: 23.5em;/*不允许出现半汉字截断*/
			}
			.service-item .service-item-content .money-color-style{
				color: #ED1717;
				font-size:18px;
			}

			.service-good ul li.jj {
				display: inline-block;
				width:100px;
				height:40px;
				border: 1px solid #1A1A1A;
				line-height: 40px;
				text-align: center;
				color: #1A1A1A;
				font-size:14px;
				margin-left: 5px;
				cursor: pointer;
			}
			.selected{
				color: #ffffff !important;
				background-color: #FF8A00;
				border: 1px solid #FF8A00 !important;
			}
			.textarea-good{
				margin-left: 5px;
				color: #202020;
				padding: 10px;
				margin-top: 10px;
			}
			.main-content-mid{
				margin: 30px;
			}


			a.clearfix.fr.commentary-btn {
				/* width: 151px; */
				/* height: 46px; */
				width: 190px;
				height: 64px;
				line-height: 64px;
				background-color: #ff8a00;
				text-align: center;
				color: #fff;
				font-size: 18px;
				/* float: left; */
				/* margin-left: 155px; */
				/* border-radius: 5px; */
			}
			.commentaryBtn.clearfix {
				width: 1200px;
				margin: 0 auto;
				text-align: center;
				margin-top: 30px;
			}

			a.commentaryBtnA {
				width: 190px;
				height: 64px;
				background: #F7843C;
				display: inline-block;
				line-height: 64px;
				font-size: 18px;
				color: #fff;
			}
			.dropdown-select{
				margin-top: 20px;
			}

			.commentary-person{
				height: 100%;
			}
			.commentary-item{
				height: 60px;
				margin-top: 20px;
			}
			.commentary-content{
				display: inline-block;
				overflow: hidden; /*自动隐藏文字*/
				text-overflow: ellipsis;/*文字隐藏后添加省略号*/
				white-space: nowrap;/*强制不换行*/
				width: 70em;/*不允许出现半汉字截断*/
				padding-left: 30px;


			}
			.commentary-time{
				display: block;
				text-align: right;
				padding-right: 20px;
				border-bottom: 1px solid #efefef;
			}




		</style>

	</head>

	<body style="background:#fff;">
	<%@include file="/header3.jsp"%>

	<div class="mainList">
			<div class="bNav">您的位置：用户中心><span>仪器评价</span></div>
			<div class="content">

				<div class="right">
					<div class="title"><span>评价回复</span></div>
					<p class="title-bot">对仪器进行评价</p>

					<!--服务标题栏-->
					<div class="service-bar">
						<ul>
							<li>仪器名称</li>
							<li>给您留下的印象</li>
						</ul>
					</div>

					<!--栏目左右布局-->
					<div class="service-left fl">
						<div id="insInfo" class="service-item clearfix">
							<div class="service-item-img fl">
								<img src="images/productDetailPic.png">
							</div>
							<div class="service-item-content fl">
								<ul>
									<li>高内涵筛选系统高内涵筛选系统高内涵筛选系统高内涵筛</li>
									<li>型号</li>
									<li class="money-color-style">¥260元/起</li>
								</ul>
							</div>
						</div>

					</div>
					<div class="service-left fl">
						<div class="service-item service-good">
							<ul>
								<li class="jj">沟通很顺畅</li>
								<li class="jj">工作效率高</li>
								<li class="jj">服务态度好</li>
							</ul>
							<textarea id="textareaVal" autofocus rows="13" cols="70" class="textarea-good" placeholder="填写服务管理人员的服务质量..."></textarea>
							<div class="dropdown-select">
								<label>仪器状态：</label>
								<select id="statusSelect">
									<option value="0">正常</option>
									<option value="1">损坏</option>
									<option value="2">需更换耗材</option>
								</select>
							</div>
							<div id="woQiSiLe">
								<ul class="upload-ul clearfix">
									<li class="upload-pick">
										<div class="webuploader-container clearfix" id="goodsUpload"></div>
									</li>
								</ul>
							</div>
						</div>

					</div>

					<!--服务标题栏-->
					<div class="service-bar clearfix">
						<ul>
							<li>对服务仪器、服务管理人员进行评分</li>
						</ul>
					</div>

					<div id="evaluateDiv" class="main-content-mid clearfix">

						<div class="goods-comm clearfix">
							<div class="goods-comm-stars">
								<span class="star_l">服务质量：</span>
								<div id="rate-comm-1" class="rate-comm"></div>
							</div>
						</div>
<br>
						<br>
						<div class="goods-comm clearfix">
							<div class="goods-comm-stars">
								<span class="star_l">仪器使用：</span>
								<div id="rate-comm-2" class="rate-comm"></div>
							</div>
						</div>



					</div>


					<!--服务标题栏-->
					<!-- <div class="service-bar clearfix">
						<ul>
							<li>仪器管理人员评价</li>
						</ul>
					</div> -->

					<!--仪器管理人员评价-->

					<!-- <div class="commentary-person">

						<ul id="commentUl" class="commentary-item">
							<li class="commentary-content">感谢您对仪器的认可，感谢您对仪器的认可，感谢您对仪器的</li>
							<li class="commentary-time">2018-4-16 18:31:21</li>
						</ul>
					</div> -->



				</div>


			</div>
		<div class="commentaryBtn clearfix" >
			<a class="commentaryBtnA" id="sub">评论</a>
		</div>

	</div>

	<!--footer-->
	<%@include file="/footer.jsp"%>
	<script src="js/jquery-1.11.3.js"></script>
	<script src="js/common.js"></script>
	<script>
        $(function() {
            $('.service-good ul li').click(function(){

                // $(this).addClass('selected').siblings().removeClass('selected');
                //hasClass检查第一个元素是否包含 selected 类
                // console.log($(".service-good ul li").text())

				if($(this).hasClass('selected')){
                    $(this).removeClass('selected');
                    var index = $('.selected').text();
                    $("#textareaVal").html(index);
                }else{
                    $(this).addClass('selected');
                    var index = $('.selected').text();
                    $("#textareaVal").html(index);
                }
                // console.log($('.selected').text());
            });
        });

	</script>

	<script type="text/javascript">
		function GetUrlByParamName(name) {
  			 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
 			 var URL =  decodeURI(window.location.search);
  			 var r = URL.substr(1).match(reg);
 			 if(r!=null){
 		        //decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码
 		         return decodeURI(r[2]);
  			 };
  		     return null;
 		};
        $(function(){
        	//alert($("#useridoflogin").val());
            $(".service-good ul li").click(function(){
                var m =""
                for(var i=0;i<$(".selected").text().length;i++){
                    if(i%5==0 && i!=0){
                        m =m+","+$(".selected").text()[i];
                    }else{
                        m =m+$(".selected").text()[i];
                    }
                }
                $("#textareaVal").html(m)
            })
        })
		$(function(){
			var serScore="";
			var insScore="";
			$(".rater-star-item").click(function(){
				if($(this).parent().parent().prev().text()=="服务质量："){
					serScore=$(this).parent().parent().next().next().text().substring(0,1);
					//alert("服务:"+serScore);
				}else{
					insScore=$(this).parent().parent().next().next().text().substring(0,1);
					//alert("仪器:"+insScore);
				}
            })
            
            $.ajax({
					url :Server + "/orderRelevant/getManagerEvaluate",
					//url :"http://localhost/orderRelevant/getManagerEvaluate",
					data : {
						"oid":GetUrlByParamName("id")
					},
					type : "POST",
					dataType: "JSON",
					success : function(data) {
						//alert(data.content+","+data.time);
						if(data.content!=undefined && data.time!=undefined){
							$("#evaluateDiv").parent().append(
								'<div class="service-bar clearfix">'+
									'<ul>'+
										'<li>仪器管理人员评价</li>'+
									'</ul>'+
								'</div>'+
								'<div class="commentary-person">'+
									'<ul id="commentUl" class="commentary-item">'+
										'<li class="commentary-content">'+data.content+'</li>'+
										'<li class="commentary-time">'+new Date(data.time).Format("yyyy-MM-dd hh:mm:ss")+'</li>'+
									'</ul>'+
								'</div>'
							);
						}
					},
			});	
            
			$.ajax({
					url :Server + "/orderRelevant/orderInsInfo",
					//url :"http://localhost/orderRelevant/orderInsInfo",
					data : {
						"oid":GetUrlByParamName("id")
					},
					type : "POST",
					dataType: "JSON",
					success : function(data) {
						$("#insInfo").html('<div class="service-item-img fl">'+
							'<img src="'+data.insInfo.infoSrc+'"></div>'+
							'<div class="service-item-content fl"><ul>'+
							'<li>'+data.insInfo.chineseName+'</li><li>'+data.insInfo.serial+'</li>'+
							'<li class="money-color-style">'+data.insInfo.total+''+data.insInfo.unit+'</li></ul></div>');
						$("#sub").click(function(){
							if(serScore==""||insScore==""){
								alert("请完成评分后再提交评价");
								return false;
							}
							//alert(serScore+"&"+insScore+"&"+$("#textareaVal").val());
							//alert($("#statusSelect option:selected").val());
							var imgStr="";
							$(".viewThumb").each(function(){
								imgStr=imgStr+$(this).children().eq(3).attr("src")+"@";
				            })
				            imgStr=imgStr.substring(0,imgStr.length-1);
							$.ajax({
								url :Server + "/orderRelevant/addInsOrderComment",
								//url :"http://localhost/orderRelevant/addInsOrderComment",
								data : {
									"serScore":serScore,
									"insScore":insScore,
									"soid":GetUrlByParamName("id"),
									"content":$("#textareaVal").val(),
									"status":$("#statusSelect option:selected").val(),
									"insId":data.inId,
									"uid":$("#useridoflogin").val(),
									"nowRate":data.rate
								},
								type : "POST",
								//dataType: "JSON",
								success : function(data) {
									//alert(data);
									//window.location.href="new_file3";
									$.ajax({
										url :Server + "/orderRelevant/uploadCommentImg",
										//url :"http://localhost/orderRelevant/uploadCommentImg",
										data : {
											"images":imgStr
										},
										type : "POST",
										//dataType: "JSON",
										success : function(data) {
											alert(data);
											window.location.href="new_file3";
											
										},
								});	
								},
						});	  
			            })
					},
			});	 
			
		})
		Date.prototype.Format = function(fmt){
				var o = {
					"M+": this.getMonth() + 1, //月份 
	       			"d+": this.getDate(), //日 
	        		"h+": this.getHours(), //小时 
	        		"m+": this.getMinutes(), //分 
	        		"s+": this.getSeconds(), //秒 
	        		"q+": Math.floor((this.getMonth() + 3) / 3), //季度 
	        		"S": this.getMilliseconds() //毫秒 
				};
				if(/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
				for(var k in o)
				if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	    		return fmt;
			}


	</script>
	<script src="imageDom/webuploader.min.js"></script>
	<script src="imageDom/diyUpload.js"></script>
	<script>
	$(function(){

	//上传图片
	var $tgaUpload = $('#goodsUpload').diyUpload({
	url:'/uploadFilePath',
	success:function( data ) { },
	error:function( err ) { },
	buttonText : '',
	accept: {
	title: "Images",
	extensions: 'gif,jpg,jpeg,bmp,png'
	},
	thumb:{
	width:120,
	height:90,
	quality:100,
	allowMagnify:true,
	crop:true,
	type:"image/jpeg"
	}
	});


	});
	</script>

	<style>

	ul.upload-ul.clearfix .upload-pick {
		height: 90px;
		width: 100px;
	border: 1px solid #ccc !important;
	}
	#woQiSiLe{
	    margin-top: 30px;
	}
	.upload-pick {
		background-position: -7px 0px;
	}
	.upload-pick:hover {
		background-position: -7px 0px;
	}
	</style>
	</body>

</html>